package cadastro.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import cadastro.model.cadastro;
import cadastro.util.conexao;
import cadastro.controllers.cadastra;

public class DaoCadastro extends cadastro {

	public Boolean salvar(cadastro cadastro1) {
		Connection c = conexao.getConnection();
		String sql = "insert into facul" + " (nome,curso,senha, perfil) values (?,?,?,?)";
		PreparedStatement stmt = null;
		try {
			stmt = c.prepareStatement(sql);
			stmt.setString(1, cadastro1.getNome());
			stmt.setString(2, cadastro1.getCurso());
			stmt.setString(3, cadastro1.getsenha());
			stmt.setString(4, cadastro1.getperfil());
			stmt.setString(4, cadastro1.getSexo());
			stmt.execute();
			return true;
			
		} catch (SQLException e) {
			e.printStackTrace();
			return false;
		}
	}
}
